In order for the script to run immediately, you need to add to qb-core/shared items:
'dream-copper'
'dream-iron'
'dream-molibden'
'dream-zinc'
'dream-lead'
'dream-silver'
'dream-tin'
'dream-diamonds'

you also add work in qb-core/shared